home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / calc16.zip / CALC.TXT < prev    next >
Text File  |  1993-04-24  |  46KB  |  1,850 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                                       CALC
  21.  
  22.  
  23.                   The Professional Calculator for Clipper (tm)
  24.  
  25.                                        by
  26.  
  27.                          Touchstone Business Creations
  28.  
  29.  
  30.  
  31.                                   Version 1.6
  32.  
  33.                                    April 1993
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.               (c) Copyright 1991,92,93 Touchstone Business Creations
  41.                               All rights reserved.
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.          1  INTRODUCTION .....................................1-1
  70.             1.1 Purpose ......................................1-1
  71.             1.2 Trademarks ...................................1-1
  72.             1.3 Technical Support ............................1-1
  73.             1.4 License Agreement ............................1-2
  74.             1.5 Programming ..................................1-4
  75.             1.6 Linking ......................................1-5
  76.             1.7 Credits ......................................1-6
  77.             1.8 Changes ......................................1-6
  78.             1.9 Coming Attractions ...........................1-7
  79.  
  80.          2  THE CALC PROGRAM .................................2-1
  81.             2.1 Usage ........................................2-1
  82.             2.2 Running the demos ............................2-1
  83.             2.3 Functions ....................................2-1
  84.                 Calculator() .................................2-2
  85.                 CalcReg() ....................................2-5
  86.                 CalcInit() ...................................2-6
  87.                 CalcPos() ....................................2-8
  88.                 CalcUDF() ....................................2-10
  89.                 CalcMemory() .................................2-13
  90.                 CalcPrint() ..................................2-14
  91.                 CalcPTape() ..................................2-17
  92.  
  93.          3  3.1 Order Form ...................................3-1
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.                                 1  INTRODUCTION
  136.  
  137.  
  138.          1.1 Purpose
  139.  
  140.               CALC has been developed for the programmer, to add a
  141.          natural, yet powerful calculator to her application.  CALC
  142.          works with the Clipper 5.01 and 5.2 development system on
  143.          IBM compatible computers.
  144.  
  145.          1.2 Trademarks.
  146.  
  147.          Clipper is a registered trademark of Computer Associates,
  148.             International, Inc.
  149.          IBM is a registered trademark of International Business
  150.             Machines.
  151.  
  152.          1.3 Technical Support.
  153.  
  154.               As a registered user, you retain the right to technical
  155.          support regarding CALC's use for a period of 45 days from
  156.          purchase.  After this, your support is at the discretion
  157.          of the technical supervisor at Touchstone Business Creations.
  158.  
  159.                To receive technical support:
  160.  
  161.                You may send your questions, requests, and other
  162.                important information to CompuServe address 73670,2561
  163.  
  164.                or call
  165.                Touchstone Business Creations
  166.                at (909) 679-3364
  167.  
  168.                or write Touchstone at
  169.                28613 River Glen Ct. #1
  170.                Menifee, CA 92584-8987
  171.  
  172.          Be sure to have your registration number at hand (or if
  173.          writing, include it, please).
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.                                       Page 1-1
  198.  
  199.  
  200.  
  201.          1.4 License Agreement.
  202.  
  203.          1.4.1 License
  204.               Touchstone Business Creations ("Touchstone") grants you
  205.          a non-exclusive license of unlimited duration to use the
  206.          Touchstone Software Programs, Documentation and Permitted
  207.          Copies ("Software") as specified in the agreement.  This
  208.          agreement specifically does not grant you any rights to patents,
  209.          copyrights, trade secrets and trademarks.
  210.  
  211.          1.4.2 Runtime
  212.               You may distribute the Software in your executable programs
  213.          without any additional license from Touchstone provided that no
  214.          part of the software can be separated in whole or in part from
  215.          your executable program.  You may not distribute the Software as
  216.          part of a Runtime Link Library ("RTL"), a Dynamic Link Library
  217.          ("DLL") or a similar runtime system.
  218.  
  219.          1.4.3 Copyright
  220.               You acknowledge and agree that the Software (including
  221.          permitted copies) is owned by Touchstone and its suppliers.
  222.          This Software is protected by United States copyright law and
  223.          international treaty provisions.  You agree to safeguard the
  224.          Software as copyrighted material.
  225.  
  226.          1.4.4 Permitted Use
  227.          You may use the Software on a single computer or terminal at a
  228.          time.  Each user of the Software must have their own licensed copy.
  229.          Provided the copy is exact (including copyright notices and serial
  230.          numbers) you may make copies of the diskette(s) for backup or
  231.          achival purposes only.  We recommend that you do this.  In addition
  232.          you may transfer one copy of the information on the diskette(s) to
  233.          a single hard disk provided that you keep and use the original
  234.          diskette(s) solely for backup or archival purposes.  You may
  235.          transfer your rights under this agreement on a permanent basis
  236.          provided that you transfer all the Software and the recipient
  237.          agrees to the terms of this agreement.  Any transfer must include
  238.          the most recent update and all prior versions.  Transfer of
  239.          out-of-date or obsolete versions of the software is expressly
  240.          prohibited.
  241.  
  242.          1.4.5 Restrictions on use
  243.          You may not network the Software or otherwise use it on
  244.          more than one computer or terminal at the same time.
  245.          You may not loan, sublicense, rent, lease, sublease, or otherwise
  246.          transfer any right to use the Software.
  247.          You may not make copies of the Software, or any portion thereof,
  248.          except as specifically provided in this agreement.  You may not
  249.          reproduce, transmit, transcribe, store in a retrieval system, or
  250.          translate into any language the Software or any part thereof.
  251.          You may not, under any circumstances, copy the documentation
  252.          supplied with the Software.
  253.          You may not disassemble, decompile, reverse engineer or create
  254.          derivative works based on the software or any portion therof.
  255.          You acknowledge that the structure and organization of the
  256.          Software are the valuable trade secrets of Touchstone.
  257.          You agree to hold such trade secrets in confidence.
  258.  
  259.  
  260.  
  261.  
  262.  
  263.                                       Page 1-2
  264.  
  265.  
  266.  
  267.          1.4.6 Limited warranty
  268.               The software is provided "as is" and without warranty of
  269.          any kind.
  270.          Touchstone does warrant the diskette(s) on which the Software is
  271.          recorded shall be free from defects in materials and workmanship
  272.          under normal use and service for a period of thirty days from date
  273.          of delivery of this package as evidenced by a copy of your receipt.
  274.          To execise your rights under this warranty you must return the
  275.          defective material to Touchstone at your expense within the
  276.          warranty period or first notify Touchstone in writing within the
  277.          warranty period that you have found a defect and return the
  278.          material immediately thereafter to Touchstone at your expense.
  279.          Touchstone's liability and your exclusive remedy and sole measure
  280.          of recoverable damages under the foregoing warranty for any
  281.          diskettes which are determined to be defective shall be,
  282.          at Touchstones options (1) return of the price paid, or (2)
  283.          repair or replacement of the defective materials.  In the event
  284.          of replacement of a diskette, the replacement will be warranted
  285.          for the remainder of the thirty days or fourteen days, whichever
  286.          is longer.
  287.            THIS WARRANTY AS SET FORTH ABOVE IS THE ONLY WARRANTY OF ANY KIND,
  288.            EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THE SOFTWARE, INCLUDING,
  289.            BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
  290.            ORIGINALITY OR FITNESS OF A PARTICULAR PURPOSE.
  291.  
  292.          1.4.7 Limitation of liability
  293.                 NEITHER TOUCHSTONE NOR ANYONE WHO HAS BEEN INVOLVED IN THE
  294.            CREATION, PRODUCTION, OR DELIVERY OF THE SOFTWARE SHALL BE LIABLE
  295.            FOR ANY LOST PROFITS OR ANY INCIDENTAL, INDIRECT, CONSEQUENTIAL,
  296.            EXEMPLARY OR SPECIAL DAMAGES OR COSTS (INCLUDING LEGAL EXPENSES,
  297.            OR LOSS OF GOODWILL) ARISING OUT OF OR RELATING TO THE USE OF,
  298.            THE RESULTS OF, OR THE INABILITY TO USE THE SOFTWARE, EVEN IF
  299.            TOUCHSTONE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
  300.            OR CLAIM.
  301.  
  302.          1.4.8 Indemnity
  303.               You agree to indemnify and defend Touchstone from and against
  304.          any and all claims, suits, damages, and expenses (including legal
  305.          expenses) brought against or suffered by Touchstone Business
  306.          Creations as a result of and failure or malfunctions of an
  307.          application within which or into which you have compiled or
  308.          incorporated the Software and/or the Software runtime modules.
  309.  
  310.          1.4.9 US Government Restricted Rights
  311.               The Software and documentation are supplied with restriced
  312.          rights.  Use, duplications or a disclosure by the Government is
  313.          subject to restrictions as set forth in subparagraph (c) (1) (ii)
  314.          of the rights in Technical Data and Computer Software Clause
  315.          at DFARS 252.227-7013 or subparagraphs (c) (1) and (2) of the
  316.          Commercial Computer Software - restricted Rights at 48 CFR
  317.          52.227-19, as applicable.  Contractor/manufacturer is
  318.          Touchstone Business Creations, 28613 River Glen Ct. #1,
  319.          Menifee, CA 92584-8987.
  320.  
  321.          1.4.10 Updates
  322.               Touchstone reserves the right, at its sole discretion, to
  323.          change, modify or update the Software at any time without the
  324.          obligation of notifying anyone.  Touchstone reserves the right
  325.          to offer updates to the Software either free of charge or for
  326.          an additional charge.  In order to be eligible to obtain updates
  327.          or information on updates you must complete and return the
  328.          supplied registration card to Touchstone.
  329.                                       Page 1-3
  330.  
  331.  
  332.  
  333.   1.5 Programming
  334.  
  335.     1.5.1 Easiest Use            (SET KEY ... TO CALCULATOR)
  336.  
  337.       #include "inkey.ch"
  338.  
  339.       Function Test()
  340.  
  341.          CALCREG(00000)                 //insert your registration number
  342.          SET KEY K_ALT_O TO CALCULATOR  //this is all you need
  343.  
  344.          nValue := 0
  345.          @ 5,5 Get nValue
  346.  
  347.          Read               //while in read, press ALT_O for the calculator
  348.  
  349.       Return NIL
  350.  
  351.       First, the above example sets your registration number (once you
  352.       receive it from Touchstone Business Creations).
  353.  
  354.       Then, it sets the key K_ALT_O to call the CALCULATOR function
  355.       when it is in a wait state (i.e. READ, MENU TO, MEMOEDIT, etc).
  356.  
  357.       Once you are in any wait state (until you choose to turn it off),
  358.       pressing ALT_O will call up the calculator function.
  359.  
  360.       If you are on a numeric value at the time, it will become the
  361.       display in the calculator.  When finished calculating, you may
  362.       press CTRL_ENTER and transfer or paste the value back into
  363.       where you were editing.
  364.  
  365.  
  366.     1.5.2 Adding Keys            ( SetKey(... , {||...}) )
  367.  
  368.       Adding keys are useful for any type of specific calculations.
  369.  
  370.       nTax := 1.0775
  371.       SetKey(K_ALT_T, {|cProc,nVer,cVar,nVal| ;
  372.                       If(c1="CALCULATOR",nVal*nTax,NIL)})
  373.  
  374.       For example, the above two lines can be added anywhere in the code
  375.       prior to using the calculator. While using it, you can press
  376.       ALT_T and the current calculator value will be multiplied by (nTax)
  377.       giving you the price with tax immediately in the display as your
  378.       current calculated value.
  379.  
  380.  
  381.       You can also be specific about the variables you use keys upon:
  382.  
  383.       nTax := 1.0775
  384.       SetKey(K_ALT_T, {|cProc,nVer,cVar,nVal| ;
  385.                       If(c1="CALCULATOR" .and. Upper(cVar)="SUBTOTAL",;
  386.                       nVal*nTax,NIL)})
  387.  
  388.       For example, the above two lines will verify (1) that we are
  389.       operating from the calculator, and (2) the variable that the
  390.       calculator was called from was named "SUBTOTAL".
  391.       Once those are true, the calculator value will be multiplied
  392.       by (nTax) giving you the price with tax.
  393.  
  394.       SEE "CALCULATOR()" information for more.
  395.                                       Page 1-4
  396.  
  397.  
  398.  
  399.    1.6 Linking CALC.LIB
  400.  
  401.  
  402.     Library
  403.  
  404.       CALC.LIB   -  This is the library that contains all the calculator
  405.                     and supporting functions.
  406.                     It can be *COMPLETELY* overlayed.
  407.  
  408.                     When prelinking, use the REFER names of "CALC15" and
  409.                     "NUMLOCK".
  410.  
  411.  
  412.     Linking (Non-overlaid use)
  413.  
  414.       Microsoft:
  415.  
  416.           LINK <yourObj>, <yourExe>, <yourMap>, <yourLib> + CALC
  417.  
  418.       Borland:
  419.  
  420.           TLINK <yourObj>, <yourExe>, <yourMap>, <yourLib> + CALC
  421.  
  422.       Blink, Inc:
  423.  
  424.           Blinker FI <yourObj> LIB CALC
  425.  
  426.       Pocket Soft:
  427.  
  428.           RTLink FI <yourObj> LIB CALC
  429.  
  430.  
  431.     Linking (Overlaid use)
  432.  
  433.       When overlaying with Blinker,
  434.       the following sample script
  435.       file can be used:
  436.  
  437.  
  438.       FILE <yourObj>
  439.  
  440.       BEGIN
  441.  
  442.           FILE <yourFiles>
  443.           ALLOCATE CALC
  444.  
  445.       END
  446.  
  447.       LIB CLIPPER, TERMINAL, DBFNTX
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.                                       Page 1-5
  462.  
  463.  
  464.  
  465.   1.7 Credits
  466.  
  467.      The Professional Calculator for Clipper (tm) was written and produced
  468.      by Jim Gale of Touchstone Business Creations.
  469.  
  470.      The CALC and all included functions are written entirely in Clipper 5.01;
  471.      however, one additional function has been added to the CALC.LIB taken
  472.      from the public domain library called NANFOR.LIB.  The function is
  473.      FT_NUMLOCK() which allows CALC to get/set the status of the numlock.
  474.      This is written in C and was added to CALC.LIB under the same name to
  475.      prevent function duplication for developers who use NANFOR.LIB.
  476.      Incidentally, this function can also be completely overlayed.
  477.  
  478.      Thanks to Ted Means for his donation of FT_NUMLOCK() to NANFOR.LIB and
  479.      to Glenn Scott for the production of NANFOR.LIB.
  480.  
  481.      Also, special thanks to the current users of CALC that have sent in
  482.      their requests for desired abilities.
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.    1.8 Changes
  490.  
  491.    The Professional Calculator for Clipper (tm)
  492.  
  493.    Rev 1.0     -  5/91   Initial release tested on CompuServe
  494.    Rev 1.1,1.2 -  6/91   Bug fixes
  495.  
  496.    Rev 1.3     -  6/91   Clean version with DOUBLE lines in calculator
  497.                            with NG file.
  498.  
  499.    Rev 1.4     -  9/91   Changed to SINGLE lines for international compat.
  500.  
  501.    Rev 1.5     -  9/92   Added positioning CalcPos(), code block exception
  502.                            handling, CalcMemory() to access memory directly,
  503.                            paper scrolling, better NG docs.
  504.  
  505.    Rev 1.51    -  4/93   Changed Address/Phone, Compiled under Clipper 5.2
  506.  
  507.    Rev 1.6     -  4/93   Added Network Printing functions CalcPrint() and
  508.                            CalcPTape(). Calc also compiled under 5.2.
  509.  
  510.    ** ALL REGISTRATIONS OF PREVIOUS REVISIONS WORK
  511.       AUTOMATICALLY WITH THE NEWEST REVISIONS **
  512.  
  513.    Revision 1.5 represents a significant change over 1.4 in the respect
  514.    that you, the programmer, have more power to control your calculator
  515.    environment.  Users have been asking for calculator positioning,
  516.    and paper scrolling which have been added; however, additional
  517.    capabilities such as the code block exception handler (CalcUDF())
  518.    allow tremendous capabilities from within the calculator.
  519.  
  520.    ** YOUR REGISTRATION OF 1.6 WILL WORK FOR ADDITIONAL REVISIONS **
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.                                       Page 1-6
  531.  
  532.  
  533.  
  534.          1.9 Coming Attractions!    ** COMING REALLY REALLY SOON **
  535.  
  536.               Other products to be released soon are:
  537.  
  538.            SciCalc()    -full-featured scientific calculator with trig and
  539.          full trig functions you may call in your programs.
  540.  
  541.            Calendar()   -pop-up full-featured calendar, scroll through
  542.          days, months, years, see and set holidays, calculate no. of
  543.          work days, and upon pressing Ctrl-Enter transfers date back
  544.          to date field.
  545.  
  546.          * Please express your interest and specific wishes for these
  547.            and other products.
  548.  
  549.          MUCH MORE!   Register to receive all notices & updates!
  550.  
  551.          ** REGISTERED USERS OF CALC WILL RECEIVE DISCOUNTS TOWARDS **
  552.          **    ANY OTHER TOUCHSTONE BUSINESS CREATIONS PRODUCT      **
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.                                       Page 1-7
  597.  
  598.  
  599.  
  600.          2.1 Usage
  601.  
  602.               Assuming that you have written a program, such as a
  603.          sample program included in this package, DEMO and DEMO2, you must
  604.          compile and link as follows (included in DEMO.rmk)
  605.  
  606.          rmake demo             and   rmake demo2
  607.  
  608.          2.2 Running Demo
  609.  
  610.               The program begins with three variables, two numeric and
  611.          one character.  To begin a calculation, press F5.  The
  612.          current value transferred into the calculator.  To receive
  613.          calculator help, press H.  When finished with your
  614.          calculation, either press Esc to exit, or Ctrl-Enter to paste
  615.          the result back to the field.  Detailed information is available
  616.          in the following reference pages.
  617.  
  618.          2.3 Functions
  619.  
  620.          The following calculator functions are formatted in the
  621.          standard form as set by the Clipper manual.  This allows you
  622.          to print these pages and place them with your manual.
  623.  
  624.          The following pages are a reference to the functions
  625.          available in CALC.
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.                                       Page 2-1
  663.  
  664.  
  665.  
  666.    Name
  667.  
  668.       CALCULATOR()
  669.  
  670.    Purpose
  671.  
  672.       On-screen Full-Function Calculator
  673.  
  674.    Syntax
  675.  
  676.       CALCULATOR( [<nInitialValue>,] [<lAutoGrabAndPaste>] )  -> nResult
  677.  
  678.    Arguments
  679.  
  680.       <nInitialValue> is a numeric value which becomes the initial value
  681.       to display in the calculator.
  682.       Defaults to zero, unless called from a READMODAL numeric variable.
  683.  
  684.       <lAutoGrabAndPaste> is a logical value; if set to true, will attempt
  685.       to grab from a numeric variable (if called from one) and will paste
  686.       if exited by pressing Ctrl-Enter.  If, however, you have reason to
  687.       prevent the numeric grabbing and the paste-back, set it to false.
  688.       Defaults to whether (1) called from a numeric variable or (2) a numeric
  689.       value was passed in <nInitialValue>.
  690.  
  691.    Returns
  692.  
  693.       A numeric result of the calculations.  If the user presses Ctrl-Enter
  694.       to exit the Calculator, the keyboard will also be stuffed with the
  695.       result.
  696.  
  697.    Description
  698.  
  699.       At its most basic use (SET KEY ... TO CALCULATOR) the calculator
  700.       will pop up on screen (with a numeric if called from a get) allowing
  701.       calculations, percentages, parenthesized calculations, memory (static),
  702.       printing, fixed decimals, and a help screen.  When pressing
  703.       Ctrl-Enter to exit, it will paste the result to your variable.
  704.  
  705.       In its more advanced use, you may set keys to do your own special
  706.       functions and calculations (SET KEY K_F9 TO FINANCIAL), or train
  707.       the calculator to search for and change to a separate color scheme,
  708.       or call a special procedure before entering the calculator, or
  709.       call the calculator as a function and return the result.
  710.  
  711.    Requirements
  712.  
  713.       You must call CalcReg( <nRegistration> ) to bypass the copyright screen.
  714.       SEE CALCREG()
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.                                       Page 2-2
  729.  
  730.  
  731.  
  732.    Examples
  733.  
  734.    * Example 1
  735.  
  736.       #include "inkey.ch"
  737.  
  738.       CalcReg(12345)                  // example registration number
  739.       Set Key K_ALT_O to Calculator
  740.  
  741.       n1:=5
  742.       c1:=Space(8)
  743.  
  744.       @ 5,5 Get n1
  745.       @ 6,5 Get c1
  746.       READ                            // press ALT_O for calculator
  747.  
  748.       *------------------------*
  749.  
  750.    * Example 2
  751.  
  752.       #include "inkey.ch"
  753.  
  754.       CalcReg(12345)
  755.  
  756.       // F5 will multiply n by 2 and return it (from calculator)
  757.       SetKey(K_F5,{|p,l,v,n| If( p="CALCULATOR", n*2, NIL ) })
  758.  
  759.       // F6 will automatically keyboard any character returns,
  760.       //  in this case, setting fixed decimals to 2
  761.       SetKey(K_F6,{|p| If( p="CALCULATOR", "F2", NIL) })
  762.  
  763.       // F1 will call the calculator's help
  764.       SetKey(K_F1,{|p| If( p="CALCULATOR", "H", NIL) })
  765.  
  766.       nResult := Calculator(5)        // pops up with a 5, returns a result
  767.  
  768.  
  769.    Notes  (FOR ADVANCED USE)
  770.  
  771.       SETKEY PROCEDURES
  772.  
  773.          When it calls your set key procedure, it will pass five parameters:
  774.  
  775.          ■ Procedure name (always CALCULATOR)
  776.  
  777.          ■ Version number (always 13 in version 1.3)
  778.  
  779.          ■ The variable name when the Calculator hotkey was pressed or NIL
  780.  
  781.          ■ Numeric representation of the current display
  782.  
  783.          ■ Character representation of the current display
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.                                       Page 2-3
  795.  
  796.  
  797.  
  798.          When you return a result, it may be numeric, character, or other:
  799.  
  800.          ■ If you return a numeric, it will become the current display
  801.  
  802.          ■ If you return a character, it will be "keyboarded" as if the
  803.            user typed it himself (be aware of your current SET TYPEAHEAD)
  804.  
  805.          ■ If you return any other value, it will be ignored
  806.  
  807.    Keys Available:
  808.  
  809.            KEY    OPERATION
  810.          ■  0-9   (standard numeric keys)
  811.          ■  +,-,/,*  (standard arithmetic keys)
  812.          ■  %     Perform percentage calculation
  813.          ■  (     Begin a sub-calculation (may be nested)
  814.          ■  )     End a sub-calculation
  815.          ■  =     End a calculation (and all sub-calculations)
  816.          ■[Enter] End a calculation (and all sub-calculations)
  817.          ■[Bksp]  backup, erase last keystroke
  818.          ■  AC    Clear all (except memory)
  819.          ■  C     Clear Entry
  820.          ■  H     Display calculator help.
  821.          ■  P     Toggle printing; if printing is used, upon exit of the
  822.                   calculator, a form feed will occur.
  823.          ■  F n   Set fixed decimals to (n).  0-9 to fix, other key for
  824.                   floating point.
  825.          ■  M+    Add to memory  (static - will keep throughout program)
  826.          ■  M-    Subtract from memory
  827.          ■  M*    Multiply to memory
  828.          ■  M/    Divide into memory
  829.          ■  MR    Recall memory
  830.          ■  MC    Clear memory
  831.          ■ [Ctrl-Left / Ctrl-Right] Move Calculator
  832.  
  833.          ■ [Esc]  Exit calculator (do not paste)
  834.          ■ [Ctrl-Enter]   Exit calculator (PASTE RESULT TO FIELD)
  835.                           (applicable when called from a variable, or
  836.                            when first parameter is numeric and second
  837.                            parameter is true)
  838.  
  839.    Files: CALC.LIB
  840.  
  841.    See Also: CALCREG()  CALCINIT()
  842.  
  843.    Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  844.            28613 River Glen Ct. #1
  845.            Menifee, CA 92584-8987
  846.  
  847.            (909) 679-3364
  848.  
  849.    Owner : (c) Copyright, 1991, Touchstone Business Creations.
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.                                       Page 2-4
  861.  
  862.  
  863.  
  864.    Name
  865.  
  866.       CALCREG()
  867.  
  868.    Purpose
  869.  
  870.       To Register the On-screen Full-Function Calculator
  871.  
  872.    Syntax
  873.  
  874.       CALCREG( <nRegisteration> )  -> NIL
  875.  
  876.    Arguments
  877.  
  878.       <nRegisteration> is a numeric value representing your registration
  879.       number.  This function will bypass the copyright screen on initial
  880.       use of the calculator.
  881.  
  882.    Returns
  883.  
  884.       CALCREG() always returns NIL
  885.  
  886.    Description
  887.  
  888.       Use CALCREG() to register your calculator and prevent the copyright
  889.       message from appearing on the initial call to the calculator.
  890.  
  891.    Requirements
  892.  
  893.       You must have a valid registration number.  You may obtain one from
  894.       Touchstone Business Creations, 28613 River Glen Ct. #1, Menifee,
  895.       California 92584 USA.   The phone number is (909) 679-3364.
  896.  
  897.    Examples
  898.  
  899.       CalcReg(12345)
  900.  
  901.    Files: CALC.LIB
  902.  
  903.    See Also: CALCULATOR()  CALCINIT()
  904.  
  905.    Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  906.            28613 River Glen Ct. #1
  907.            Menifee, CA 92584-8987
  908.  
  909.            (909) 679-3364
  910.  
  911.    Owner : (c) Copyright, 1991, Touchstone Business Creations
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.                                       Page 2-5
  927.  
  928.  
  929.  
  930.    Name
  931.  
  932.       CALCINIT()
  933.  
  934.    Purpose
  935.  
  936.       To set the calculator colors or a set of colors to recognize and
  937.       replace.
  938.  
  939.    Syntax
  940.  
  941.       CALCINIT( [<caColors>] )  -> NIL
  942.  
  943.    Arguments
  944.  
  945.       <caColors> may be a character color value, an array of colors,
  946.       or other data type.
  947.  
  948.       Defaults to NIL (automatically setting the colors to "W+/B" on a
  949.        color adapter)
  950.  
  951.    Returns
  952.  
  953.       CALCINIT() always returns NIL
  954.  
  955.    Description
  956.  
  957.       You may use CALCINIT() to set the calculator colors or to search
  958.       and replace set of colors, or to default to current colors.
  959.  
  960.       Regarding the parameter <caColors>:
  961.  
  962.       ■ If it is a character color value, it must be in the standard color
  963.         format (i.e. "W+/R") (SEE EXAMPLE 1)
  964.  
  965.       ■ If it is an array, it must be two dimensional, the first to search
  966.         and match the current colorset (it must contain one comma);
  967.         the second to set the color upon finding a match (SEE EXAMPLE 2)
  968.  
  969.       ■ If it is NIL (the default), it will set the calculator colors to "N/W"
  970.         (SEE EXAMPLE 3)
  971.  
  972.       ■ If it is any other data type (such as logical), it will keep the
  973.         colors that it was called with (SEE EXAMPLE 4)
  974.  
  975.    Examples
  976.  
  977.        ** Example 1 - character parameter
  978.  
  979.         CALCINIT( "W+/R" )  // calculator will now operate as white on blue
  980.         Calculator()
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.                                       Page 2-6
  993.  
  994.  
  995.  
  996.        ** Example 2 - array
  997.  
  998.         aColors :=  {   {"W+/N," , "N/W" } ,;   //color must include comma
  999.                         {"R+/B," , "B+/R"} ,;
  1000.                         {""      , "W/N" }   }  //all non-matched colors
  1001.                                                 // will match with ""
  1002.  
  1003.         CalcInit( aColors )
  1004.  
  1005.         The above example will (upon calling the calculator), check the
  1006.         current color against "W+/N," and, if found, set the color to "N/W".
  1007.         If not, will compare against "R+/B," and, if found set the color to
  1008.         "B+/R".  If neither is found, the "" will be matched and the color
  1009.         set to "W/N".
  1010.  
  1011.  
  1012.        ** Example 3 - NIL  (default)
  1013.  
  1014.         CalcInit(NIL)       // or never issuing a CalcInit()
  1015.  
  1016.         SetColor("W/R")
  1017.         Calculator()        // this will operate the calculator in the default
  1018.                             //  color of W+/B
  1019.  
  1020.  
  1021.        ** Example 4 - other, (logical)
  1022.  
  1023.         CalcInit(.T.)
  1024.  
  1025.         SetColor("W/R")
  1026.         Calculator()        // this will operate the calculator in W/R
  1027.  
  1028.    Files: CALC.LIB
  1029.  
  1030.    See Also: CALCPOS()  CALCUDF()  CALCULATOR()  CALCREG()
  1031.  
  1032.    Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1033.            28613 River Glen Ct. #1
  1034.            Menifee, CA 92584-8987
  1035.  
  1036.            (909) 679-3364
  1037.  
  1038.    Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.                                       Page 2-7
  1059.  
  1060.  
  1061.  
  1062.    Name
  1063.  
  1064.       CALCPOS()
  1065.  
  1066.    Purpose
  1067.  
  1068.       To get/set the calculator initial screen position.
  1069.  
  1070.    Syntax
  1071.  
  1072.       CALCPOS( [<aPosition>] )  -> aOldPosition
  1073.  
  1074.    Arguments
  1075.  
  1076.       <aPosition> is an optional array parameter containing {<nRow>,<nCol>}.
  1077.  
  1078.       If you specify an empty array ({}), CALCPOS() will default the
  1079.       calculator position to the following:
  1080.  
  1081.       Defaults to {} (automatically setting the position to a row of
  1082.        MaxRow()-12, and the column to 0 if your cursor is >=40
  1083.        or to MaxCol()-24 if your cursor is <40).
  1084.  
  1085.    Returns
  1086.  
  1087.       CALCPOS() returns the current CALCPOS() array setting of
  1088.       {<nRow>,<nCol>}.
  1089.  
  1090.    Description
  1091.  
  1092.       You may use CALCPOS() to get/set the calculator initial screen
  1093.       position.
  1094.  
  1095.       Regarding the parameter <aPosition>:
  1096.  
  1097.       ■ If it is an empty array (the default), it will set
  1098.         the row to MaxRow()-12, and the column to 0 if your current
  1099.         screen cursor position is greater than or equal to 40,
  1100.         or to MaxCol()-24 if your cursor is less than 40.
  1101.         ( i.e. CALCPOS({}) )
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.                                       Page 2-8
  1125.  
  1126.  
  1127.  
  1128.    Examples
  1129.  
  1130.        ** Example 1 - array with positions
  1131.  
  1132.         //Positions the initial display of
  1133.         //the calculator at MaxRow()-13,4.
  1134.         aOldPos := CALCPOS( MaxRow()-13, 4 )
  1135.  
  1136.         Calculator()
  1137.  
  1138.  
  1139.        ** Example 2 - empty array
  1140.  
  1141.         aOldPos := CALCPOS( {} )
  1142.  
  1143.         Calculator()
  1144.  
  1145.         Defaults the row to MaxRow()-12 and the col to
  1146.           If( Col() > (MaxCol()+1)/2, 0, MaxCol()-24 )
  1147.  
  1148.  
  1149.    Files: CALC.LIB
  1150.  
  1151.    See Also: CALCINIT()  CALCUDF()  CALCULATOR()  CALCREG()
  1152.  
  1153.    Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1154.            28613 River Glen Ct. #1
  1155.            Menifee, CA 92584-8987
  1156.  
  1157.            (909) 679-3364
  1158.  
  1159.    Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.                                       Page 2-9
  1191.  
  1192.  
  1193.  
  1194.    Name
  1195.  
  1196.       CALCUDF()
  1197.  
  1198.    Purpose
  1199.  
  1200.       To get/set the calculator key handler block.
  1201.  
  1202.    Syntax
  1203.  
  1204.       CALCUDF( [<bCalcUDF>], [<lAllKeys>] )  -> bOldCalcUDF
  1205.  
  1206.    Arguments
  1207.  
  1208.       <bCalcUDF> is an optional block parameter containing a code block
  1209.       to evaluate upon (0) initialization, (1) operational keys,
  1210.       (2) keyboard exceptions, and (3) termination.  DEFAULTS TO NIL.
  1211.  
  1212.       <lAllKeys> is an optional logical parameter denoting whether to
  1213.       call the code block upon operational keys (i.e. not only keyboard
  1214.       exceptions). DEFAULTS TO FALSE.
  1215.  
  1216.    Returns
  1217.  
  1218.       CALCUDF() returns the current CALCUDF() code block.
  1219.  
  1220.    Description
  1221.  
  1222.       You may use CALCUDF() to get/set the calculator key handler block.
  1223.  
  1224.       Regarding the code block <bCalcUDF> (If it is not NIL):
  1225.  
  1226.       ■ Will be evaluated with 7 parameters:
  1227.  
  1228.          ■ Procedure name (always CALCULATOR)
  1229.          ■ Version number (always 16 in version 1.6)
  1230.          ■ The variable name when the Calculator hotkey was pressed or NIL
  1231.          ■ Numeric representation of the current display
  1232.          ■ Character representation of the current display
  1233.          ■ Numeric mode (0=initialization call, 1=a key was pressed,
  1234.              2=key exception, 3=termination)
  1235.          ■ Character representation of the current calculator color
  1236.          ■ Numeric representation of the last key pressed
  1237.              (valid for mode #1 and 2 only) (same as LastKey())
  1238.  
  1239.       ■ Will send as the 6th parameter the numeric mode:
  1240.  
  1241.          0 = called upon entering the calculator
  1242.              (best time to set up your own help screen for your keys)
  1243.  
  1244.          2 = called upon a key exception (a key not recognized by
  1245.              the calculator operation and no setkey exists)
  1246.  
  1247.          3 = called upon exiting the calculator
  1248.              (best time to take down your help)
  1249.  
  1250.          (If <lAllKeys> is true, then mode 1 will be called,
  1251.           else if will not be called):
  1252.          1 = called upon any keypress in the calulator,
  1253.              prior to executing any operation that the key represents
  1254.  
  1255.  
  1256.                                       Page 2-10
  1257.  
  1258.  
  1259.  
  1260.       ■ Return Values of the code block
  1261.  
  1262.          (The following applies to mode 0, 1, and 2 only - not 3):
  1263.  
  1264.          ■ If your code block returns a TRUE, the calcuator will immediately
  1265.            return without further processing.
  1266.  
  1267.          ■ If your code block returns a NUMERIC, the calculator will
  1268.            display the numeric as the last result of the calculator.
  1269.  
  1270.          ■ If your code block returns a CHARACTER, it will be "keyboarded"
  1271.            into the calculator as if the user had typed it him/herself
  1272.            (Be aware of the current SET TYPEAHEAD).
  1273.  
  1274.          ■ Any other data type will be ignored and processing will
  1275.            continue normally.
  1276.  
  1277.    Examples
  1278.  
  1279.        ** Example
  1280.  
  1281.         Function Test()
  1282.  
  1283.         //Sets the UDF to call during the calculator
  1284.         // but (.F.) do not call with ALL keys
  1285.         bOldUDF := CALCUDF( {|x1,x2,x3,x4,x5,x6,x7,x8| ;
  1286.                     MyCalcUDF(x1,x2,x3,x4,x5,x6,x7,x8) } , .F. )
  1287.  
  1288.         Calculator()
  1289.  
  1290.         RETURN NIL
  1291.  
  1292.  
  1293.         Function MyCalcUDF(cProc,nVer,cVar,nValue,cValue,nMode,cColor,nKey)
  1294.         Local xRetCode := .F.  //continue normally
  1295.  
  1296.            Do Case
  1297.               Case nMode = 0   //Initialization call
  1298.                  //put up extra help menu for *MY* keys & save screen
  1299.  
  1300.               Case nMode = 3   //Termination call
  1301.                  //take down my help screen
  1302.  
  1303.               Case nMode = 2   //Key Exception call
  1304.                  Do Case
  1305.                     Case nKey == K_ALT_F2     //my Square Root
  1306.                        xRetCode := SQRT(nValue)
  1307.  
  1308.                     Case nKey == K_ALT_T      //my add tax key!
  1309.                        xRetCode := nValue * 1.0775
  1310.  
  1311.                     Case nKey == "~"          //my sign reverse key!
  1312.                        xRetCode := -nValue
  1313.  
  1314.                     Case nKey == K_ALT_M      //my memory counter key!
  1315.                        CalcMemory( CalcMemory()+1 )
  1316.  
  1317.                  Endcase
  1318.  
  1319.            Endcase
  1320.  
  1321.         Return xRetCode
  1322.                                       Page 2-11
  1323.  
  1324.  
  1325.  
  1326.        * NOTE *
  1327.  
  1328.      (When initially entering the calculator, or during keyboard calls):
  1329.  
  1330.          ■ If your code block returns a TRUE, it will immediately
  1331.            abandon the calculator without further processing.
  1332.  
  1333.          ■ If your code block returns a NUMERIC, the calculator will
  1334.            display the numeric as the last result of the calculator.
  1335.  
  1336.          ■ If your code block returns a CHARACTER, it will be "keyboarded"
  1337.            into the calculator as if the user had typed it him/herself
  1338.            (Be aware of the current SET TYPEAHEAD).
  1339.  
  1340.          ■ Any other data type will be ignored and processing will
  1341.            continue normally.
  1342.  
  1343.      This NOTE does not apply to the call when exiting the calculator.
  1344.  
  1345.  
  1346.  
  1347.    Files: CALC.LIB
  1348.  
  1349.    See Also: CALCPOS()  CALCINIT()  CALCULATOR()  CALCREG()
  1350.  
  1351.    Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1352.            28613 River Glen Ct. #1
  1353.            Menifee, CA 92584-8987
  1354.  
  1355.            (909) 679-3364
  1356.  
  1357.    Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.                                       Page 2-12
  1389.  
  1390.  
  1391.  
  1392.    Name
  1393.  
  1394.       CALCMEMORY()
  1395.  
  1396.    Purpose
  1397.  
  1398.       To get/set the calculator static memory.
  1399.  
  1400.    Syntax
  1401.  
  1402.       CALCMEMORY( [<nNewMemory>] )  -> nOldMemory
  1403.  
  1404.    Arguments
  1405.  
  1406.       <nNewMemory> is an optional numeric parameter containing the
  1407.       new value for the calculator memory functions (M+,M-,M*,M/,MR,MC).
  1408.  
  1409.    Returns
  1410.  
  1411.       CALCMEMORY() returns the current static memory value.
  1412.  
  1413.    Description
  1414.  
  1415.       You may use CALCMEMORY() to get/set the calculator static memory
  1416.       value.
  1417.  
  1418.    Examples
  1419.  
  1420.        ** Example - adding to memory all sales
  1421.  
  1422.         //upon pressing ALT_M, the value+tax will be added to memory.
  1423.  
  1424.         SetKey(K_ALT_M,{|cProc,n1,c1,nValue| ;
  1425.                If(cProc="CALCULATOR",CalcMemory( CalcMemory() +
  1426.                (nValue * 1.0775) ),NIL)})
  1427.  
  1428.         Calculator()
  1429.  
  1430.  
  1431.    Files: CALC.LIB
  1432.  
  1433.    See Also: CALCULATOR()
  1434.  
  1435.    Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1436.            28613 River Glen Ct. #1
  1437.            Menifee, CA 92584-8987
  1438.  
  1439.            (909) 679-3364
  1440.  
  1441.    Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.                                       Page 2-13
  1455.  
  1456.  
  1457.  
  1458.    Name
  1459.  
  1460.       CALCPRINT()
  1461.  
  1462.    Purpose
  1463.  
  1464.       To get/set the calculator printing status.
  1465.  
  1466.    Syntax
  1467.  
  1468.       CALCPRINT( [<nNewStatus>] )  -> nOldStatus
  1469.  
  1470.    Arguments
  1471.  
  1472.       <nNewStatus> is an optional numeric parameter containing the new
  1473.       printing status.
  1474.  
  1475.       If you specify 0, all printing will occur normally.
  1476.       (When "Printing" is turned on, all lines will be printed as they are
  1477.       entered).
  1478.  
  1479.       If you specify 1, all printing will be held until you exit the
  1480.       calculator - then all lines will be printed at once.
  1481.  
  1482.       If you specify 2, all calculator printing will be held during the
  1483.       entire execution of the application.  You must then specify
  1484.       CalcPrint(-1) to force a print, or CalcPrint(-2) to cancel a print,
  1485.       or CalcPrint(1) to allow the calculator to print all lines at the
  1486.       end of the next use.
  1487.  
  1488.       If you specify 3, all printing will be suspended, and not kept
  1489.       in memory.
  1490.  
  1491.       Defaults to 0 if no network is detected, or 1 is a network is detected.
  1492.  
  1493.    Returns
  1494.  
  1495.       CALCPRINT() returns the current CALCPRINT() printing status.
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.                                       Page 2-14
  1521.  
  1522.  
  1523.  
  1524.    Description
  1525.  
  1526.       * NOTE *
  1527.  
  1528.       Printing must be turned on by user pressing the "P" key during use
  1529.       for any printing to occur.
  1530.  
  1531.  
  1532.       You may use CALCPRINT() to get/set the calculator printing status.
  1533.  
  1534.       Regarding the parameter <nNewStatus>:
  1535.  
  1536.       ■ If it is 0, all printing will occur normally.  After the user
  1537.         presses "P" to begin printing, each line will be sent to the
  1538.         printer whenever the paper scrolls.
  1539.         ^B(NON-NETWORK DEFAULT)^B
  1540.  
  1541.       ■ If it is 1, all printing will be held until the user exits the
  1542.         calculator.  At that time, all lines (during that specific use
  1543.         of the calculator) will be printed.  The tape is then purged
  1544.         and recording starts again at the next iteration.
  1545.         ^B(NETWORK DEFAULT)^B
  1546.  
  1547.       ■ If it is 2, all printing will be held throughout the execution
  1548.         of the application regardless of how many times the user enters
  1549.         and exits the calculator.
  1550.  
  1551.         To affect printing while in this status, you may:
  1552.  
  1553.            ■ Call CALCPRINT(-1) with the -1 parameter:
  1554.              This will force a print of the tape and purge it for the
  1555.              next or current use.
  1556.  
  1557.            ■ Call CALCPRINT(-2) with the -2 parameter:
  1558.              This will purge the tape for the next or current use.
  1559.  
  1560.            ■ Call CALCPRINT(1) with the 1 parameter:
  1561.              This will 'tell' the Calculator to print the tape at the
  1562.              end of the next or current use of the calculator.
  1563.  
  1564.              * NOTE *
  1565.  
  1566.              The current CALCPRINT() status DOES NOT CHANGE if you call it
  1567.              with a -1 or -2.  For example, if you first issue CalcPrint(2)
  1568.              and later print the tape by issuing CalcPrint(-1), if you then
  1569.              print the status ( ? CalcPrint() ), it will return a 2.
  1570.  
  1571.  
  1572.      * NOTE *
  1573.  
  1574.       Although highly unlikely, if the length of the calculator tape exceeds
  1575.       32,000 characters, it will cease to record further lines until purged.
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.                                       Page 2-15
  1587.  
  1588.  
  1589.  
  1590.    Examples
  1591.  
  1592.        ** Example - adding to memory all sales
  1593.  
  1594.         //upon pressing ALT_M, the value+tax will be added to memory.
  1595.  
  1596.         SetKey(K_ALT_M,{|cProc,n1,c1,nValue| ;
  1597.                If(cProc="CALCULATOR",CalcMemory( CalcMemory() +
  1598.                (nValue * 1.0775) ),NIL)})
  1599.  
  1600.         Calculator()
  1601.  
  1602.  
  1603.    Files: CALC.LIB
  1604.  
  1605.    See Also: CALCPTAPE()
  1606.  
  1607.    Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1608.            28613 River Glen Ct. #1
  1609.            Menifee, CA 92584-8987
  1610.  
  1611.            (909) 679-3364
  1612.  
  1613.    Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.                                       Page 2-16
  1653.  
  1654.  
  1655.  
  1656.    Name
  1657.  
  1658.       CALCPTAPE()
  1659.  
  1660.    Purpose
  1661.  
  1662.       To get/set the calculator printing tape.
  1663.  
  1664.    Syntax  
  1665.  
  1666.       CALCPTAPE( [<cNewTape>] )  -> nOldTape
  1667.  
  1668.    Arguments  
  1669.  
  1670.       <nNewTape> is an optional character parameter containing the new
  1671.       printing tape.
  1672.  
  1673.  
  1674.      * NOTE *
  1675.  
  1676.       This IS NOT the scrolling tape found at the top of the calculator.
  1677.  
  1678.       This IS the tape accumulated by using a CALCPRINT(2) or CALCPRINT(1)
  1679.       printing status (See CALCPRINT).
  1680.  
  1681.  
  1682.    Returns  
  1683.  
  1684.       CALCPTAPE() returns the current calculator printing tape. (This tape
  1685.       will be printed according to the current CALCPRINT printing status).
  1686.  
  1687.    Description  
  1688.  
  1689.      * NOTE *
  1690.  
  1691.       Printing must be turned on by user pressing the "P" key during use
  1692.       for any printing to occur.
  1693.  
  1694.  
  1695.       You may use CALCPTAPE() to get/set the calculator printing status.
  1696.  
  1697.       Regarding the tape:
  1698.  
  1699.       ■  Each line is separated by a CRLF combination.
  1700.       ■  Each iteration (use) of the calculator is separated by a Chr(12)
  1701.          Eject character.
  1702.       ■  CALCPRINT(-1) forces a complete print and purge of the tape.
  1703.       ■  CALCPRINT(-2) purges the tape.
  1704.  
  1705.      * NOTE *
  1706.  
  1707.       Although highly unlikely, if the length of the calculator tape exceeds
  1708.       32,000 characters, it will cease to record further lines until purged.
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.                                       Page 2-17
  1719.  
  1720.  
  1721.  
  1722.    Examples  
  1723.  
  1724.      ** Example 1 - Adding a Header
  1725.  
  1726.         CalcPrint(1)  //hold printing throughout use of the calculator.
  1727.  
  1728.         //Holds a header
  1729.         CalcPTape("Calculator 1.6 (c) Touchstone"+Chr(13)+Chr(10))
  1730.  
  1731.         Calculator()  // (printing is performed upon escape or exit)
  1732.  
  1733.      ** Example 2 - Print Tape Later
  1734.  
  1735.         CalcPrint(2)  //hold printing until further commands change it
  1736.         Calculator()  // (nothing is printed)
  1737.  
  1738.         ...
  1739.  
  1740.         //Adds a footer to the tape
  1741.         CalcPTape( CalcPTape()+" --- from Touchstone "+Chr(13)+Chr(10) )
  1742.  
  1743.         //Prints the complete tape (with footer)
  1744.         CalcPrint(-1)
  1745.  
  1746.    Files: CALC.LIB
  1747.  
  1748.    See Also: CALCPRINT()
  1749.  
  1750.    Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1751.            28613 River Glen Ct. #1
  1752.            Menifee, CA 92584-8987 USA
  1753.  
  1754.            (909) 679-3364
  1755.  
  1756.    Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.                                       Page 2-18
  1785.  
  1786.  
  1787.                                      ORDER FORM
  1788.  
  1789.      Make and send CHECK or MONEY ORDER payable to:
  1790.  
  1791.  
  1792.      TO:  Touchstone Business Creations
  1793.           28613 River Glen Ct. #1
  1794.           Menifee, CA 92584-8987
  1795.           U.S.A.
  1796.           (909) 679-3364
  1797.           CompuServe #: 73670,2561
  1798.  
  1799.  
  1800.      From:  Full Name:               ____________________________________
  1801.  
  1802.             Company Name (if any):   ____________________________________
  1803.  
  1804.             Street Address:          ____________________________________
  1805.  
  1806.             City, State, Zip:        ____________________________________
  1807.  
  1808.             Country:                 ____________________________________
  1809.  
  1810.             VOICE Phone:             ____________________________________
  1811.  
  1812.             FAX Phone:               ____________________________________
  1813.  
  1814.             CompuServe #:            ____________________________________
  1815.  
  1816.  
  1817.      Desired Registration & Disk:
  1818.  
  1819.      CALC ver 1.6 Registration only:          $59.95 x Qty____ =  $_____
  1820.  
  1821.      CALC next version automatic UPGRADE:     $39.95 x Qty____ =  $_____
  1822.       (adding this amount will guarantee
  1823.        your receiving the next version
  1824.        immediately when available)
  1825.       (INCLUDES DISK AND SHIPPING)
  1826.       OFFER ONLY VALID WITH CALC VER 1.x REGISTRATION
  1827.  
  1828.      CALC Disk (if necessary) (SPECIFY TYPE)  $7                  $_____
  1829.       circle one:    3 1/2"    5 1/4"
  1830.  
  1831.      California residents, add sales tax (Riverside County)       $_____
  1832.       (currently 7.75%)
  1833.  
  1834.                                               ---------------------------
  1835.  
  1836.      TOTAL Enclosed:                                              $_____
  1837.  
  1838.  
  1839.      When you register, we will send you your registration number to use in
  1840.      your program to inhibit the copyright notice.  This will be a simple
  1841.      one sheet letter.  If you require the disks sent to you, there is an
  1842.      additional $7 charge for postage, handling and material (listed above).
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.                                       Page 3-1
  1850.